<script type="text/html" template
        lay-url="{{ window.globalConfig.url_cms_list + '/' + layui.router().search.id }}"
        lay-done="layui.data.done(d);">
    <title>新闻详情</title>

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">
                        <a lay-href="home/article/cmslist/list"
                           class="layui-btn layui-btn-primary layui-btn-sm">返回上级</a>
                        {{ d.data.title }}
                    </div>
                    <div class="layui-card-body">

                        <div class="layui-form" lay-filter="LAY-home-cmslist-listform" id="LAY-home-cmslist-listform"
                             style="padding: 20px 30px 0 0;">
                            <div class="layui-form-item">
                                <label class="layui-form-label">详情名称</label>
                                <div class="layui-input-inline" style="width: 50%">
                                    <input type="text" name="title" value="{{ d.data.title || '' }}"
                                           lay-verify="required"
                                           placeholder="请输入详情名称" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>


                            <!-- 新闻分类 -->
                            <div class="layui-form-item">
                                <label class="layui-form-label">新闻分类</label>
                                <div class="layui-input-inline">
                                    <input type="text" id="catName" value=""
                                           class="layui-input" readonly/>
                                    <input type="hidden" id="catId" name="cat_id"
                                           value="{{ d.data.cat_id }}"
                                           class="layui-input"/>

                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">作者</label>
                                <div class="layui-input-inline" style="width: 50%">
                                    <input type="text" name="author"
                                           value="{{ d.data.author || layui.setter.customerName }}"
                                           placeholder="请输入作者" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">来源</label>
                                <div class="layui-input-inline" style="width: 50%">
                                    <input type="text" name="source" value="{{ d.data.source || layui.setter.customerName }}"
                                           placeholder="请输入来源" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">封面图片</label>
                                <div class="layui-input-block">
                                    <div class="layui-upload-list" id="ID-upload-mobile-ico-btn">

                                        <img
                                                {{# if(d.data.photo){ }}
                                                src="{{ window.globalConfig.img_bind_url + d.data.photo}}"
                                                {{# } else { }}
                                                src="./res/style/imgs/upload.png"
                                                {{# } }}

                                                id="ID-upload-photo-img" style="max-width: 500px"
                                                class="layui-upload-img">
                                    </div>
                                </div>
                                <div class="layui-form-mid layui-word-aux size-suggest"></div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">置顶</label>
                                <div class="layui-input-inline">

                                    <input type="checkbox" name="is_top" title="开启|关闭" value="1" lay-skin="switch"
                                           {{# if(d.data.is_top){ }}
                                           checked
                                           {{# } }}
                                    >

                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">加精</label>
                                <div class="layui-input-inline">

                                    <input type="checkbox" name="is_best" title="开启|关闭" value="1" lay-skin="switch"
                                           {{# if(d.data.is_best){ }}
                                           checked
                                           {{# } }}
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">热门</label>
                                <div class="layui-input-inline">

                                    <input type="checkbox" name="is_hot" title="开启|关闭" value="1" lay-skin="switch"
                                           {{# if(d.data.is_hot){ }}
                                           checked
                                           {{# } }}
                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">显示</label>
                                <div class="layui-input-inline">

                                    <input type="checkbox" name="is_show" title="开启|关闭" value="1" lay-skin="switch"
                                           {{# if(d.data.is_show){ }}
                                           checked
                                           {{# } }}
                                    >
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">发布时间</label>
                                <div class="layui-input-inline" style="width: 50%">
                                    <input type="text" class="layui-input" name="showtime" value="{{ d.data.showtime }}"
                                           id="ID-laydate-news-showtime" placeholder="yyyy-MM-dd HH:mm:ss">
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">新闻摘要</label>
                                <div class="layui-input-inline">

                                     <textarea name="content2" style="width: 400px; height: 150px;"
                                               autocomplete="off"
                                               class="layui-textarea">
                                        {{ d.data.content2 }}
                                      </textarea>
                                </div>
                            </div>

                            <!-- 视频地址 -->
                            <div class="layui-form-item">
                                <label class="layui-form-label">视频地址</label>
                                <div class="layui-input-inline" style="width: 90%">

                                     <input type="text" name="link" value="{{ d.data.link }}"
                                           placeholder="请输入视频地址" autocomplete="off" class="layui-input"
                                    >
                                </div>
                            </div>

                            <!--  富文本  -->
                            <div class="layui-form-item">
                                <label class="layui-form-label">信息内容</label>
                                <div class="layui-input-inline" style="width: 100%">
                                    <div id="editor"></div>
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">排序</label>
                                <div class="layui-input-inline">
                                    <input type="number" lay-affix="number" min="0" name="sort_order"
                                           value="{{ d.data.sort_order | 0 }}"
                                           lay-verify="required"
                                           placeholder="请输入排序" autocomplete="off" class="layui-input"
                                           {{# if(d.data.mode=='read' ){ }}
                                           readonly
                                           {{# } }}

                                    >
                                </div>
                            </div>

                            <div class="layui-form-item">
                                <label class="layui-form-label">点击量</label>
                                <div class="layui-input-inline">
                                    <input type="number" lay-affix="number" min="0" name="click_count"
                                           value="{{ d.data.click_count | 0 }}"
                                           lay-verify="required"
                                           placeholder="请输入排序" autocomplete="off" class="layui-input"
                                           {{# if(d.data.mode=='read' ){ }}
                                           readonly
                                           {{# } }}

                                    >
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">SEO标题</label>
                                <div class="layui-input-inline" style="width: 50%">
                                    <input type="text" name="pagetitle" value="{{ d.data.pagetitle || '' }}"
                                           placeholder="请输入网页标题"
                                           autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">SEO关键词</label>
                                <div class="layui-input-inline" style="width: 50%">
                                    <input type="text" name="pagekeywords" value="{{ d.data.pagekeywords || '' }}"
                                           placeholder="请输入关键词" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">SEO描述</label>
                                <div class="layui-input-inline" style="width: 50%">
                            <textarea name="pagedesc" style="width: 400px; height: 150px;"
                                      autocomplete="off"
                                      class="layui-textarea">{{ d.data.pagedesc }}</textarea>
                                </div>
                            </div>


                            <div class="layui-form-item">
                                <label class="layui-form-label">自定义URL</label>
                                <div class="layui-input-inline" style="width: 50%">
                                    <input type="text" name="urlrewriter" id="urlrewriter" value="{{ d.data.urlrewriter || '' }}"
                                           placeholder="请输入自定义URL" autocomplete="off" class="layui-input"
                                           lay-verify="required"
                                    >
                                </div>
                            </div>

                            <input type="hidden" name="content" id="editor-content" value="{{ d.data.content }}">
                            <input type="hidden" name="photo" id="photo" value="{{ d.data.photo }}">
                            <input type="hidden" name="article_id" value="{{ d.data.article_id }}">
                            {{# if(d.data.mode != 'read'){ }}
                            <div class="layui-form-item">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-inline">
                                    <input type="button" lay-submit lay-filter="LAY-home-cmslist-listform-submit"
                                           value="保存"
                                           class="layui-btn">
                                </div>
                            </div>
                            {{# } }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<script src="res/modules/articleCms.js"></script>
